package action;

import java.util.List;




import entity.Account;
import entity.Contest;
import entity.Follow;
import entity.FollowId;
import service.FollowDAO;
import service.impl.AccountDAOImpl;
import service.impl.ContestDAOImpl;
import service.impl.FollowDAOImpl;

public class FollowAction extends SuperAction{
	
	private int account_id;
	private int contest_id;
	
	public void query(int chuan_account_id){
		FollowDAO fdao = new FollowDAOImpl();
		System.out.println("tuxue2");
		List<Contest> conlist = fdao.query(chuan_account_id);
		if(conlist==null)System.out.println("this is null");
		session.setAttribute("follow_Contest", conlist);
	}
	
	
	public String signUp(){
		FollowDAO fdao = new FollowDAOImpl();
		Account account = new AccountDAOImpl().queryByAccount_id(1);
		Contest contest = new ContestDAOImpl().queryByContest_id(3159);
		Follow fo = new Follow(new FollowId(contest, account));
		fdao.signUp(fo);
		query(account_id);
		return NONE;
	}
}
